home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
programs
/
falkv63.zip
/
PORTSET.DOC
< prev
next >
Wrap
Text File
|
1992-01-22
|
5KB
|
105 lines
PORTSET Documentation.
Written by Herb Rose, 23 Sept 1991.
Placed into the public domain by Herb Rose, 23 Sept 1991
PORTSET is a DOS utility for sending text to a specific serial port.
It was written as a support utility for Falken BBS. To use SETPORT,
simply enter the SETPORT command at the DOS prompt. The required
command line parameters are :
SETPORT <port> <baud> <text>
where :
<port> is the serial port you wish to send text to. This may be
COM1, COM2, COM3, COM4, or the actual address of the serial
port. COM1-COM4 correspond to addresses 3F8, 2F8, 3E8, 2E8,
respectively.
If you have a multiport card installed, and wish to configure
the ports on that card, you would issue a separate SETPORT
command for each port on the card. These normally start at
address 100 and go up from there. i.e.
SETPORT 100 2400 "atz\r" would send the string atz<CR> to
the serial port at address 100, at 2400 baud.
<baud> is the baud rate to set the serial port for. The port is
left configured to this baud rate after SETPORT runs. The
legal values are : 300, 1200, 2400, 4800, 9600, 19200.
<text> is the actual text you wish to send to the serial port.
I recommend enclosing the text in quotes. This keeps the
text together as one text string, even if there are spaces in
the text. Modem commands should end with a \r which is
interpreted as a Carriage Return ( ENTER key ). Modems will
not execute commands until the \r is sent.
Special characters recognized :
\r = carriage return, hex 0D
\n = line feed, hex 0A
\^ = put a caret (^) in the text
^x = where 'x' is any character - place a control character
in the text. i.e. ^M is ctrl-M, or carriage return.
To place the ^ in the text, use \^.
Example :
To set a 2400 baud modem for Falkens suggested modem configuration...
PORTSET COM1 2400 "ATE0 S0=1 S2=1 V1 &C1 &D2\r"
AT : the modem attention signal. Tells the modem that commands follow.
E0 : turn off local echo from the modem.
S0=1 : answer phone after 1 ring
S2=1 : set modem escape character to hex 01
V1 : use verbose (text) result codes.
&C1 : DCD signal follows carrier detect
&D2 : Modem resets and enters Command Mode when DTR goes high
The modem should respond with 'OK' after processing this command text.
As you can see, the main purpose of this program is to configure modems
from the command line. Many modems on the market now have Non-Volatile
RAM (NVRAM) where configurations may be stored even if the modem is
powered off. This utility allows you to set the configuration you desire
in the modem, and save it to NVRAM. This is normally done with the &W
command. The configuration can then be recalled from NVRAM simply by
resetting the modem with the Z command ("ATZ\r").
PORTSET does not use serial interrupts. It accomplishes it's task using
polling techniques. It should not interfere with any installed serial
drivers, or with any other resident programs that I am aware of. It may
not work correctly with some multitaskers, because it uses the DOS
timer interrupt to control it's polling routine.
Some PCs are slower than others. In general, there should be no problem
running PORTSET on any computer at speeds up to 19200. If you have an
XT running at 4.77 mhz, you may have to limit the baud rate to 9600 for
reliable data exchange.
PORTSET performs the following functions :
1. Determines if a UART actually resides at the specified port
address. To determine this, PORTSET attempts to place the UART
in Local Loopback mode. It then toggles the DTR and RTS bits
of the Line Control Register. If there is an 8250-type UART
at that address, the DTR and RTS bits will be reflected in
the DSR/CTS bits of the modem status register during loopback.
If the DSR/CTS bits do not correspond with the DTR/RTS bits,
then either there is no UART there, or it is not working.
2. Turns interrupts off for the specified port.
3. Sets the port for 8 bits, no parity, 1 stop bit.
4. Sets the baud rate for the port.
5. Lowers DTR and RTS signals. Some modems are configured to enter
Command Mode when DTR goes low.
6. After a 2 second pause, RTS and DTR are raised again.
7. The text is transmitted to the modem, and all characters received
from the modem are echoed to the screen. A 5 second interval is
used to get data from the modem.
8. The interrupt enable, line control, and modem control registers
are restored to their original conditions.